home *** CD-ROM | disk | FTP | other *** search
Wrap
/* Adds /ALIAS /FINDG to Amirc prefs */ ttl='Add2AmIRC.rexx' LF='0A'x call addlib('rexxreqtools.library',0,-30,0) nal='ALIAS FINDG /rx 'aap' %p' if ~req('This Script will Add/OverWrite the ALIAS'LF'/FINDG in your Default.AmIRCfg file'LF || LF'Use ''/findg ?'' to get possible args','_Continue|_Abort') then exit call req('Please Select the path of'LF'your AmIRC Directory','_OK') cfg=reqdir(':')'Default.AMIRCfg' if ~exists(cfg) then do if amd=='AMD' then amd='Aborted' call req('Error: finding Default.AmIRCfg in'LF' Path: 'amd,'_OK') exit end call req('Please Select the path of'LF'your Aminet.awnp File','_OK') aap=reqdir('sys:tools/Aminet.awnp',"f") call open(ah,aap); call readln(ah);aln=readln(ah); call close(ah) if index(aln,"$VER: Aminet.awnp ")==0 then do call req('Error: finding Aminet.awnp Data in'LF' Path: 'aap,'_OK') exit end call open(ih,cfg) call open(oh,'T:Default.AmIRCfg',W) at=0 alias0=0 do while ~eof(ih) ln = readln(ih); if at=="a" then do if ln=="" then do; at="e" ; call checkalias() end else do alias0=alias0+1 alias.alias0=ln end end if at==0 then do if ln=="# Alias list" then at="a" call writeln(oh,ln) end if at=="e" then call writeln(oh,ln) end call close(ih) call close(oh) rq=req('Default.AmIRCfg Will be Changed.' || '0A'X || '' || '0A'X || 'Backup: Default.AmIRCfg' || '0A'X || ' As: Default.AmIRCfg.bak ?','_YES|_NO|_Abort') if rq == 0 then call deteteit() if rq == 1 then address command 'copy clone "'cfg'" "'cfg'.bak"' address command 'copy clone T:Default.AmIRCfg "'cfg'"' deleteit: address command 'delete <>nil: T:Default.AmIRCfg' exit(0) checkalias: do c=1 to alias0 wd=upper(word(alias.c,2)) if wd=="FINDG" then nop else; call writeln(oh,alias.c) end call writeln(oh,nal) return req: rq = rtezrequest(arg(1),arg(2),'Add2AmIRC.rexx','rt_reqpos = reqpos_centerscr rt_leftoffset = 120') return rq reqdir: PROCEDURE if arg(2)=="f" then fi=""; else; fi="rtfi_flags=freqf_nofiles" newf = rtfilerequest(arg(1),,"Select AmIRC dir","OK",fi) RETURN(newf)